<extend name="Extends/base" />
<block name="title">任务管理后台</block>
<block name="css">
    <style>
        .menu-collapse .sub-menu li a {
            background: #f5f5f5
        }
    </style>
</block>
<block name="body_style">class="bgc-f2f4f6"</block>
<block name="body">
    <div class="page-layout-menu c-position-f c-hidden" data-toggle="pageLayoutMenu">
        <div class="referral-menu-box">
            <include file="Index/menuBox" />
        </div>
    </div>
    <div class="page-layout-main c-position-a">
        <div class="clearfix c-border-b" style="line-height: 45px">
            <div class="fr mr5">
                {$userInfo.phone}
                (<span class="c-f90">
                    <if condition="$userInfo['role'] eq 1">超级管理员</if>
                    <if condition="$userInfo['role'] eq 2">系统管理员</if>
                    <if condition="$userInfo['role'] eq 3">普通管理员</if>
                </span>)
                <a href="javascript:;" class="loginout c-btn-green c-btn-tiny mlr10">退出登录</a>
            </div>
        </div>
        <iframe frameborder="no" src="{:C('WEB_DOMAIN')}/Console/Index/welcome" width="100%"
            id="referralIframe"></iframe>
    </div>
</block>
<block name="js">
    <script type="text/javascript" src="__PC__/widget/nicescroll/3.6.0/js/jquery.nicescroll.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $(".page-layout-menu").height($(window).height()).niceScroll({
                cursorborder: "",
                cursorcolor: "#cccdd1"
            });

            $('#referralIframe').height($(window).height() - 46);
        });

        $('.loginout').on('click', function () {
            $.sAjax({
                "url": "{:C('WEB_DOMAIN')}/Console/Login/doLogout"
            }).success(function () {
                location.reload();
            });
        });

        //点击导航展开
        $('.menu-li>a').on('click', function () {
            $('.menu-li>a').removeClass("curr");
            $(this).addClass("curr");
            $('.sub-menu').hide();
            $(this).parent().find('.sub-menu').show();
        })

        //导航滚动条
        $('.page-layout-menu').on('click', function () {
            $(".page-layout-menu").getNiceScroll().resize();
        });
        //导航滚动条
        $(".page-layout-menu").on('mouseover', function () {
            $(".page-layout-menu").getNiceScroll().resize();
        });
        //导航加载iframe
        $('.menu-collapse').on('click', 'a', function () {
            $('.menu-collapse a').removeClass("curr");
            $(this).addClass("curr");
            $('#referralIframe').attr('src', $(this).data('src'));
        });
    </script>
</block>